package com.yogee.topseller.fragment.zhoubian;

import android.app.Dialog;
import android.app.DialogFragment;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.yogee.topseller.R;
import com.yogee.topseller.activity.DingyueListActivity;
import com.yogee.topseller.activity.PayActivity;
import com.yogee.topseller.activity.ProductDetailsActivity;


/**
 * Created by Administrator on 2016/9/16.
 */
public class DingyueFragment extends DialogFragment {

    private TextView tv1,tv2;

    @Override
    public Dialog onCreateDialog(Bundle savedInstanceState) {
        final Dialog mDetailDialog = new Dialog(getActivity(), R.style.dialog);
        mDetailDialog.setContentView(R.layout.pop_dingyue);
        mDetailDialog.setCancelable(false);
        final String ids = getArguments().getString("ids");
        final int position = getArguments().getInt("position");

        TextView refresh_tv = (TextView) mDetailDialog.findViewById(R.id.refresh_tv);
        refresh_tv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ((DingyueListActivity)getActivity()).removeItem(ids,position);
//                startActivity(new Intent().setClass(getActivity(), PayActivity.class));
                mDetailDialog.dismiss();

            }
        });

        TextView tv_return = (TextView) mDetailDialog.findViewById(R.id.tv_return);
        tv_return.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                mDetailDialog.dismiss();
            }
        });

        return mDetailDialog;
    }


}
